//
//  SceneDelegate.m
//  chongwu
//
//  Created by 隼目 on 2021/9/15.
//

#import "SceneDelegate.h"

@interface SceneDelegate ()

@end

@implementation SceneDelegate


- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
 
//    SignInViewController *vc=[[SignInViewController alloc] init];
//    UINavigationController *nav1= [[UINavigationController alloc] initWithRootViewController:vc];
//    self.window.rootViewController=nav1;
    
    MailViewController *mail=[[MailViewController alloc] init];
    mail.isHidenBackgroundImage=YES;
    mail.navigationItem.title=@"寄件";
    OrderViewController *order=[[OrderViewController alloc] init];
    order.isHidenBackgroundImage=YES;
    MessageViewController *message=[[MessageViewController alloc] init];
    message.isHidenDog=YES;
    MyViewController *my=[[MyViewController alloc] init];
    my.isHidenBackgroundImage=YES;
    my.navigationItem.title=@"我的";

    UINavigationController *nav1= [[UINavigationController alloc] initWithRootViewController:mail];
    UINavigationController *nav2= [[UINavigationController alloc] initWithRootViewController:order];
    UINavigationController *nav3= [[UINavigationController alloc] initWithRootViewController:message];
    UINavigationController *nav4= [[UINavigationController alloc] initWithRootViewController:my];

    nav1.title=@"寄件";
    nav2.title=@"订单";
    nav3.title=@"消息";
    nav4.title=@"我的";
    nav3.navigationItem.title=@"消息";


    [nav1.tabBarItem setSelectedImage:[UIImage imageNamed:@"jijian"]];
    [nav1.tabBarItem setImage:[UIImage imageNamed:@"jijianhui"]];

    [nav2.tabBarItem setSelectedImage:[UIImage imageNamed:@"dingdan"]];
    [nav2.tabBarItem setImage:[UIImage imageNamed:@"dingdanhui"]];

    [nav3.tabBarItem setSelectedImage:[UIImage imageNamed:@"xiaoxi"]];
    [nav3.tabBarItem setImage:[UIImage imageNamed:@"xiaoxihui"]];

    [nav4.tabBarItem setSelectedImage:[UIImage imageNamed:@"wode"]];
    [nav4.tabBarItem setImage:[UIImage imageNamed:@"wodehui"]];

    [[UITabBar appearance] setTintColor:rgba(255,102,0,1)];

    UITabBarController *bar=[[UITabBarController alloc] init];
    bar.viewControllers=@[nav1,nav2,nav3,nav4];
    self.window.rootViewController=bar;
}


- (void)sceneDidDisconnect:(UIScene *)scene {
    // Called as the scene is being released by the system.
    // This occurs shortly after the scene enters the background, or when its session is discarded.
    // Release any resources associated with this scene that can be re-created the next time the scene connects.
    // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
}


- (void)sceneDidBecomeActive:(UIScene *)scene {
    // Called when the scene has moved from an inactive state to an active state.
    // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
}


- (void)sceneWillResignActive:(UIScene *)scene {
    // Called when the scene will move from an active state to an inactive state.
    // This may occur due to temporary interruptions (ex. an incoming phone call).
}


- (void)sceneWillEnterForeground:(UIScene *)scene {
    // Called as the scene transitions from the background to the foreground.
    // Use this method to undo the changes made on entering the background.
}


- (void)sceneDidEnterBackground:(UIScene *)scene {
    // Called as the scene transitions from the foreground to the background.
    // Use this method to save data, release shared resources, and store enough scene-specific state information
    // to restore the scene back to its current state.
}


@end
